<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="/struts-tags" prefix="s"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>后台管理</title>

		<script type="text/javascript">
			$(function() {
				$("#product").addClass("active");
				$("#product").find("ul li").eq(3).addClass("active");
			})
		</script>
	</head>
	<body>
		<div class="admin">

			<div class="panel admin-panel">
				<div class="panel-head">
					<div class="line-middle">

						<div class="x11">
							<strong>运费模板</strong>
						</div>
						<div class="x1">

						</div>
					</div>
				</div>
				<div class="padding border-bottom">



				</div>
				<table class="table table-hover">
					<tr>
						<th width="200">
							省份
						</th>
						<th width="200">
							1件以内
						</th>
						<th width="200">
							每增加1件需要增加的费用
						</th>
						<th width="200">
							操作
						</th>
					</tr>
				</table>
				<br/>



				<s:iterator value="yunfeis" var="y">
					<s:if test="#y.name=='全国'">
						<form name="form" action="yunfei!update.action" method="post">
							<input type="hidden" name="yunfei.id"
								value="<s:property value="id"/>" />
							<div class="line-middle">
								<div class="x1">
									&nbsp; &nbsp;
									<strong><s:property value="name" />：</strong>
								</div>
								<div class="x4">
									<div class="form-group">
										<div class="field">
											<input name="yunfei.one" value="<s:property value="one"/>"
												type="text" class="input " data-validate="double:必须为数字"
												placeholder="请输入1件以内的运费" />
										</div>
									</div>
								</div>

								<div class="x4">
									<div class="form-group">
										<div class="field">
											<input name="yunfei.two" value="<s:property value="two"/>"
												type="text" class="input " data-validate="double:必须为数字"
												placeholder="请输入每增加1件要增加的运费" />
										</div>
									</div>
								</div>

								<div class="x3">
									<button type="submit" class="button button-small bg-blue">
										保存
									</button>
									&nbsp;&nbsp;
									<a class="button border-yellow button-small"
										href="javascript:void(0)" onclick=
	change();
>同步到各省</a>
								</div>
							</div>
						</form>
						<br/>
						<br/>
						<br/>
					</s:if>

					<s:else>
						<form action="yunfei!update.action" method="post">
							<input type="hidden" name="yunfei.id"
								value="<s:property value="id"/>" />
							<div class="line-middle">
								<div class="x1">
									&nbsp; &nbsp;
									<strong style="color: gray;"><s:property value="name" />：</strong>
								</div>
								<div class="x4">
									<div class="form-group">
										<div class="field">
											<input name="yunfei.one" value="<s:property value="one"/>"
												type="text" class="input " data-validate="double:必须为数字"
												placeholder="请输入1件以内的运费" />
										</div>
									</div>
								</div>

								<div class="x4">
									<div class="form-group">
										<div class="field">
											<input name="yunfei.two" value="<s:property value="two"/>"
												type="text" class="input " data-validate="double:必须为数字"
												placeholder="请输入每增加1件要增加的运费" />
										</div>
									</div>
								</div>

								<div class="x3">
									<button type="submit" class="button button-small bg-blue">
										保存
									</button>
								</div>
							</div>
						</form>
						<br/>

					</s:else>
				</s:iterator>

			</div>

			<br />

		</div>

		<script language="javascript">
	function change() {

		document.form.action = "yunfei!piliang.action";

		document.form.submit();
	}
</script>
	</body>
</html>